<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数值扩展</title>
</head>
<body>
    <script>
        //1. 二进制和八进制   
        let b = 0b1010;
        let o = 0o707;
        let d = 5211314;
        let x = 0xffa;

        //2. Number.isFinite  检测一个数值是否为有限数
        // console.log(Number.isFinite(1000));
        // console.log(Number.isFinite(Math.PI));// 3.1415926  无理数 

        //3. Number.isNaN 检测一个数值是否为 NaN  isNaN
        // console.log(Number.isNaN(NaN));

        //4. Number.parseInt 字符串转整数 
        // console.log(Number.parseInt('123abc'));
        // console.log(Number('123abc'));

        //5. Math.trunc 将数字的小数部分抹掉 
        // console.log(Math.trunc(3.6));

        //6. Number.isInteger 判断一个数是否为整数 is 是否 integer 整型
        // console.log(Number.isInteger(3));
        // console.log(Number.isInteger(2.5));

        //7. 幂运算  (ES7)    3 4
        let result = 3 ** 4;
        let res = Math.pow(3, 4);
        console.log(result);
        console.log(res);

    </script>
</body>
</html>